package com.evildog.workspace.log.application.feign;


import com.evildog.workspace.common.result.Result;
import com.evildog.workspace.common.result.ResultGenerator;
import com.evildog.workspace.log.application.convert.AccessLogConvert;
import com.evildog.workspace.log.application.service.AccessLogService;
import com.evildog.workspace.log.api.feign.AccessLogClient;
import com.evildog.workspace.log.api.model.AccessLogParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * accessLog feign client
    访问日志
 * </p>
 *
 * @author evildog
 * @since 2020-08-29
 */
@RestController
@RequestMapping(AccessLogClient.API_PREFIX)
@AllArgsConstructor
@Api(tags = "accessLog相关接口")
public class AccessLogClientImpl implements AccessLogClient {

    private AccessLogService accessLogService;


    @Override
    @PostMapping
    @ApiOperation(value = "添加接口")
    public Result<Boolean> save(@RequestBody AccessLogParam accessLogParam) {
        return ResultGenerator.status(accessLogService.save(AccessLogConvert.INSTANCE.convert(accessLogParam)));
    }

}

